// src/stores/useStore.js
import create from 'zustand';
let storage = window.localStorage;

const useStore = create((set) => ({
  nowroute: "",
  setnowroute: (nowroute) => {storage.nowroute = JSON.stringify(nowroute);set((state) => ({ nowroute: nowroute }))},
  collapsed: false,
  setcollapsed: (collapsed) => set((state) => ({ collapsed: collapsed })),
  needrefreshsclist: false,
  setneedrefreshsclist: (needrefreshsclist) => set((state) => ({ needrefreshsclist: needrefreshsclist })),
  anpz: null,
  setanpz: (anpz) => set((state) => ({ anpz: anpz })),
}));

export default useStore;